import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.lang.reflect.Type;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.Set;

/**
 * @author hemj
 * @version 2017/9/19
 */
public class FastjsonParser extends Parser {

	public FastjsonParser(String fullFileDir) {
		super(fullFileDir);
	}

	@Override
	public void process() {
		try {
			InputStream fileReader = new FileInputStream(this.fullFileDir);
			JSONObject jsonObject = JSON.parseObject(fileReader, Charset.forName("UTF-8"), null);
			Set<Map.Entry<String, Object>> entrySet = jsonObject.entrySet();
			for (Map.Entry<String, Object> entry : entrySet) {
				Object value = entry.getValue();
			}
			fileReader.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
